<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>多角色服务平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
        }
        
        body {
            background-color: #f8f9fa;
            color: #333;
            overflow-x: hidden;
        }
        
        /* 头部样式 */
        .header {
            background: linear-gradient(135deg, #1890ff, #096dd9);
            color: white;
            padding: 12px 15px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            position: sticky;
            top: 0;
            z-index: 1000;
        }
        
        .top-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        
        .location {
            display: flex;
            align-items: center;
            font-size: 14px;
        }
        
        .location i {
            margin-right: 5px;
        }
        
        .user-info {
            display: flex;
            align-items: center;
        }
        
        .avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background-color: #fff;
            color: #1890ff;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 8px;
            font-weight: bold;
            font-size: 14px;
        }
        
        /* 广告区域 */
        .ad-banner {
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 6px;
            padding: 8px 15px;
            margin: 5px 0;
            font-size: 13px;
            display: flex;
            align-items: center;
            overflow: hidden;
        }
        
        .ad-banner i {
            margin-right: 8px;
            animation: pulse 2s infinite;
        }
        
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }
        
        /* 主内容区 */
        .content {
            padding: 15px;
            min-height: calc(100vh - 120px);
        }
        
        /* 五大功能区 */
        .main-sections {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 15px;
            margin: 15px 0;
        }
        
        .section-card {
            background: white;
            border-radius: 10px;
            padding: 15px 8px;
            text-align: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            transition: transform 0.3s ease;
            cursor: pointer;
        }
        
        .section-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }
        
        .section-icon {
            font-size: 24px;
            margin-bottom: 8px;
            color: #1890ff;
        }
        
        .section-title {
            font-size: 13px;
            font-weight: 500;
        }
        
        /* 悬赏展示区 */
        .bounty-section {
            background: white;
            border-radius: 10px;
            padding: 15px;
            margin: 20px 0;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }
        
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid #eee;
        }
        
        .section-title-large {
            font-size: 16px;
            font-weight: 600;
            color: #333;
        }
        
        .see-all {
            font-size: 12px;
            color: #1890ff;
        }
        
        .bounty-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        
        .bounty-card {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 12px;
            border: 1px solid #eee;
        }
        
        .bounty-title {
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 6px;
        }
        
        .bounty-details {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: #666;
        }
        
        .bounty-amount {
            color: #fa541c;
            font-weight: 600;
        }
        
        /* 底部功能区 */
        .action-buttons {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
            margin: 20px 0;
        }
        
        .action-btn {
            background: white;
            border-radius: 8px;
            padding: 12px;
            text-align: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            cursor: pointer;
        }
        
        .btn-icon {
            font-size: 18px;
            color: #1890ff;
            margin-bottom: 5px;
        }
        
        .btn-text {
            font-size: 12px;
        }
        
        /* TabBar 底部导航 */
        .tabbar {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 60px;
            background: #fff;
            border-top: 1px solid #eee;
            display: flex;
            justify-content: space-around;
            align-items: center;
            z-index: 1000;
        }
        
        .tab-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            flex: 1;
            height: 100%;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
        }
        
        .tab-icon {
            font-size: 20px;
            margin-bottom: 4px;
        }
        
        .tab-label {
            font-size: 11px;
        }
        
        /* 角色差异化样式 */
        /* 普通用户 */
        .user-tab .tab-item:nth-child(1) .tab-icon,
        .user-tab .tab-item:nth-child(2) .tab-icon {
            color: #1890ff;
        }
        
        /* 从业者 */
        .worker-tab .tab-item:nth-child(1) .tab-icon,
        .worker-tab .tab-item:nth-child(2) .tab-icon {
            color: #52c41a;
        }
        
        /* 商家 */
        .merchant-tab .tab-item:nth-child(1) .tab-icon,
        .merchant-tab .tab-item:nth-child(2) .tab-icon {
            color: #fa8c16;
        }
        
        /* 隐藏其他角色的TabBar */
        .hidden {
            display: none;
        }
        
        /* 角色切换菜单 */
        .role-selector {
            background: #fff;
            border-radius: 10px;
            padding: 10px;
            margin-bottom: 15px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            display: flex;
            overflow-x: auto;
            -ms-overflow-style: none;
            scrollbar-width: none;
        }
        
        .role-selector::-webkit-scrollbar {
            display: none;
        }
        
        .role-btn {
            padding: 8px 15px;
            margin: 0 5px;
            background: #f5f5f5;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s;
            white-space: nowrap;
            font-size: 14px;
        }
        
        .role-btn.active {
            background: #1890ff;
            color: white;
        }
    </style>
</head>
<body>
    <!-- 头部区域 -->
    <div class="header">
        <div class="top-bar">
            <div class="location">
                <i class="fas fa-map-marker-alt"></i>
                <span id="current-city">南宁市</span>
            </div>
            <div class="user-info">
                <div class="avatar">张</div>
                <div class="user-name">张三</div>
            </div>
        </div>
        <div class="id-display">
            <span>平台ID: </span><span id="user-id">NF123456</span>
        </div>
        <div class="ad-banner">
            <i class="fas fa-bullhorn"></i>
            <span>新用户首单立减10元，立即接单！</span>
        </div>
    </div>
    
    <!-- 角色选择菜单 -->
    <div class="content">
        <div class="role-selector">
            <div class="role-btn active" data-role="user">普通用户</div>
            <div class="role-btn" data-role="worker">从业者</div>
            <div class="role-btn" data-role="merchant">商家</div>
            <div class="role-btn" data-role="trainer">培训商</div>
            <div class="role-btn" data-role="service">服务商</div>
        </div>
        
        <!-- 五大功能区 -->
        <div class="main-sections">
            <div class="section-card">
                <div class="section-icon">
                    <i class="fas fa-calendar-day"></i>
                </div>
                <div class="section-title">日结区</div>
            </div>
            <div class="section-card">
                <div class="section-icon">
                    <i class="fas fa-tasks"></i>
                </div>
                <div class="section-title">悬赏区</div>
            </div>
            <div class="section-card">
                <div class="section-icon">
                    <i class="fas fa-graduation-cap"></i>
                </div>
                <div class="section-title">能力提升</div>
            </div>
            <div class="section-card">
                <div class="section-icon">
                    <i class="fas fa-industry"></i>
                </div>
                <div class="section-title">工厂招聘</div>
            </div>
            <div class="section-card">
                <div class="section-icon">
                    <i class="fas fa-briefcase"></i>
                </div>
                <div class="section-title">特殊招聘</div>
            </div>
        </div>
        
        <!-- 热门悬赏展示区 -->
        <div class="bounty-section">
            <div class="section-header">
                <div class="section-title-large">热门悬赏</div>
                <div class="see-all">查看全部 ></div>
            </div>
            <div class="bounty-grid">
                <div class="bounty-card">
                    <div class="bounty-title">网站前端开发</div>
                    <div class="bounty-details">
                        <div>3天交付</div>
                        <div class="bounty-amount">￥1200</div>
                    </div>
                </div>
                <div class="bounty-card">
                    <div class="bounty-title">产品包装设计</div>
                    <div class="bounty-details">
                        <div>2天交付</div>
                        <div class="bounty-amount">￥800</div>
                    </div>
                </div>
                <div class="bounty-card">
                    <div class="bounty-title">文案撰写</div>
                    <div class="bounty-details">
                        <div>今天完成</div>
                        <div class="bounty-amount">￥300</div>
                    </div>
                </div>
                <div class="bounty-card">
                    <div class="bounty-title">数据录入</div>
                    <div class="bounty-details">
                        <div>日结</div>
                        <div class="bounty-amount">￥150</div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 底部功能区 -->
        <div class="action-buttons">
            <div class="action-btn">
                <div class="btn-icon">
                    <i class="fas fa-store"></i>
                </div>
                <div class="btn-text">成为商家</div>
            </div>
            <div class="action-btn">
                <div class="btn-icon">
                    <i class="fas fa-user-tie"></i>
                </div>
                <div class="btn-text">成为从业者</div>
            </div>
            <div class="action-btn">
                <div class="btn-icon">
                    <i class="fas fa-info-circle"></i>
                </div>
                <div class="btn-text">信息</div>
            </div>
            <div class="action-btn">
                <div class="btn-icon">
                    <i class="fas fa-headset"></i>
                </div>
                <div class="btn-text">联系我们</div>
            </div>
        </div>
    </div>
    
    <!-- 普通用户 TabBar -->
    <nav class="tabbar user-tab">
        <div class="tab-item active">
            <div class="tab-icon"><i class="fas fa-home"></i></div>
            <div class="tab-label">接单广场</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-tasks"></i></div>
            <div class="tab-label">悬赏大厅</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-graduation-cap"></i></div>
            <div class="tab-label">能力提升</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-industry"></i></div>
            <div class="tab-label">工厂招聘</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-user"></i></div>
            <div class="tab-label">个人中心</div>
        </div>
    </nav>
    
    <!-- 从业者 TabBar -->
    <nav class="tabbar worker-tab hidden">
        <div class="tab-item active">
            <div class="tab-icon"><i class="fas fa-list"></i></div>
            <div class="tab-label">任务大厅</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-wallet"></i></div>
            <div class="tab-label">钱包</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-history"></i></div>
            <div class="tab-label">接单记录</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-star"></i></div>
            <div class="tab-label">信用评级</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-user"></i></div>
            <div class="tab-label">我的</div>
        </div>
    </nav>
    
    <!-- 商家 TabBar -->
    <nav class="tabbar merchant-tab hidden">
        <div class="tab-item active">
            <div class="tab-icon"><i class="fas fa-chart-line"></i></div>
            <div class="tab-label">店铺数据</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-bullhorn"></i></div>
            <div class="tab-label">推广工具</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-users"></i></div>
            <div class="tab-label">客户管理</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-file-invoice"></i></div>
            <div class="tab-label">订单处理</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-user"></i></div>
            <div class="tab-label">我的</div>
        </div>
    </nav>
    
    <script>
        // 角色切换函数
        function switchRole(role) {
            // 隐藏所有TabBar
            document.querySelectorAll('.tabbar').forEach(tab => {
                tab.classList.add('hidden');
            });
            
            // 显示目标TabBar
            const targetTab = document.querySelector(`.${role}-tab`);
            if (targetTab) {
                targetTab.classList.remove('hidden');
            }
            
            // 更新角色按钮状态
            document.querySelectorAll('.role-btn').forEach(btn => {
                btn.classList.remove('active');
                if (btn.dataset.role === role) {
                    btn.classList.add('active');
                }
            });
        }
        
        // 为所有角色按钮添加事件
        document.querySelectorAll('.role-btn').forEach(btn => {
            btn.addEventListener('click', () => {
                switchRole(btn.dataset.role);
            });
        });
        
        // 为Tab项添加点击事件
        document.querySelectorAll('.tab-item').forEach(item => {
            item.addEventListener('click', function() {
                // 清除同一TabBar中所有项目的激活状态
                const parentTab = this.closest('.tabbar');
                parentTab.querySelectorAll('.tab-item').forEach(el => {
                    el.classList.remove('active');
                });
                
                // 激活当前点击的Tab
                this.classList.add('active');
                
                // 在实际应用中，这里应该加载对应功能的内容
                const actionText = this.querySelector('.tab-label').textContent;
                alert(`已切换到: ${actionText}`);
            });
        });
        
        // 功能区点击事件
        document.querySelectorAll('.section-card').forEach(card => {
            card.addEventListener('click', function() {
                const sectionName = this.querySelector('.section-title').textContent;
                alert(`进入${sectionName}功能区`);
            });
        });
        
        // 底部功能区点击事件
        document.querySelectorAll('.action-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const actionName = this.querySelector('.btn-text').textContent;
                alert(`操作: ${actionName}`);
            });
        });
        
        // 初始化显示普通用户 TabBar
        switchRole('user');
    </script>
</body>
</html>